tstr = input('')
if tstr[-1] in ['f','F']:
    c = (float(tstr[0:-1])-32)/1.8
    print("{:.2f}C".format(c))
elif tstr[-1] in ['c','C']:
    f = float(tstr[0:-1])*1.8+32
    print("{:.2f}F".format(f))
else:
    print('输入格式错误')